package cloud.daodao.storm.common.dict.api;

import cloud.daodao.storm.common.dict.constant.DictConstant;
import cloud.daodao.storm.common.dict.model.codemap.CodeMapData;
import cloud.daodao.storm.common.dict.model.codemap.CodeMapSearch;
import cloud.daodao.storm.common.dict.model.codemap.CodeMapSelect;
import cloud.daodao.storm.common.dict.model.codemap.CodeMapUpsert;
import cloud.daodao.storm.common.constant.AppConstant;
import cloud.daodao.storm.common.model.PageData;
import cloud.daodao.storm.common.model.PageParam;
import cloud.daodao.storm.common.model.Request;
import cloud.daodao.storm.common.model.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

/**
 * @author DaoDao
 **/
@Tag(name = "CodeMapApi", description = "代码映射")
@HttpExchange(url = AppConstant.API)
public interface CodeMapApi {

    @Operation(summary = "代码映射查询", description = "@DaoDao 代码映射查询")
    @PostExchange(url = DictConstant.CODE_MAP_SELECT)
    Response<CodeMapData> codeMapSelect(@RequestBody @Valid Request<CodeMapSelect> request);

    @Operation(summary = "代码映射写入", description = "@DaoDao 代码映射写入")
    @PostExchange(url = DictConstant.CODE_MAP_UPSERT)
    Response<CodeMapData> codeMapUpsert(@RequestBody @Valid Request<CodeMapUpsert> request);

    @Operation(summary = "代码映射搜索", description = "@DaoDao 代码映射搜索")
    @PostExchange(url = DictConstant.CODE_MAP_SEARCH)
    Response<PageData<CodeMapData>> codeMapSearch(@RequestBody @Valid Request<PageParam<CodeMapSearch>> request);

}
